package action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import servlet.IServletAction;
import bean.MyPageEntity;
import bean.ServletActionForward;
import bean.UserInfo;
import dao.FavorProductDAO;

public class MyFavorProductListAction implements IServletAction {

	@Override
	public ServletActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		System.out.println("*********************************** MyFavorProductListAction In *********************************");
		ServletActionForward forward = new ServletActionForward();
		forward.setURL("/mypage_scrap.jsp");
		forward.setValue(true);
		
		UserInfo userInfo = (UserInfo)request.getSession().getAttribute("userInfo");
		
		FavorProductDAO dao = new FavorProductDAO();
		
		List<MyPageEntity> list = dao.getMyFavorProductList(userInfo.getUserId());
		
		request.setAttribute("list", list);				
		
		return forward;
	}

}
